home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / WDELETEL.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  71 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef wdeleteln
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_wdeletel = "$Header: c:/curses/portable/RCS/wdeletel.c%v 2.0 1992/11/15 03:29:06 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   wdeleteln()  - remove line from window
  15.  
  16.   X/Open Description:
  17.        The line under the cursor in the window is deleted.  All
  18.        lines below the current line are moved up one line.  The
  19.        bottom line of the window is cleared.  The cursor position
  20.        does not change.
  21.  
  22.        NOTE: deleteln() is a macro.
  23.  
  24.   PDCurses Description:
  25.        No additional functionality.
  26.  
  27.   X/Open Return Value:
  28.        The wdeleteln() function returns OK on success and ERR on error.
  29.  
  30.   PDCurses Errors:
  31.        It is an error to pass a NULL window pointer to this routine.
  32.  
  33.   Portability:
  34.        PDCurses        int wdeleteln( WINDOW* win );
  35.        X/Open Dec '88  int wdeleteln( WINDOW* win );
  36.        BSD Curses      int wdeleteln( WINDOW* win );
  37.        SYS V Curses    int wdeleteln( WINDOW* win );
  38.  
  39. **man-end**********************************************************************/
  40.  
  41. int    wdeleteln(WINDOW *win)
  42. {
  43. static chtype  blank;
  44.        chtype* end;
  45.        chtype* temp;
  46.        int     y;
  47.  
  48.        if (win == (WINDOW *)NULL)
  49.                return( ERR );
  50.  
  51.        blank   = win->_blank | win->_attrs;
  52.        temp    = win->_y[win->_cury];
  53.  
  54.        for (y = win->_cury; y < win->_bmarg; y++)
  55.        {
  56.                win->_y[y]       = win->_y[y + 1];
  57.                win->_firstch[y] = 0;
  58.                win->_lastch[y] = win->_maxx - 1;
  59.        }
  60.  
  61.        win->_firstch[y]                = 0;
  62.        win->_lastch[y]         = win->_maxx - 1;
  63.        win->_y[win->_bmarg]    = temp;
  64.  
  65.        for (end = &(temp[win->_maxx - 1]); temp <= end;)
  66.        {
  67.                *temp++ = blank;
  68.        }
  69.        return( OK );
  70. }
  71.